import { history } from 'umi';
import ep from '@/utils/eventproxy';
import Cookies from 'js-cookie';
import api from '@/network/api';

const {
  userApi: { getUserinfo, clearLogin },
} = api;

let initState = () => ({
  //权限
  authority: [],

  // 用户信息
  user: {
    userId: '',
    name: '',
    orgId: '',
    orgList: '',
    telNum: '',
    empNum: '',
    username: '',
  },
});

export default {
  namespace: 'user',
  state: { ...initState() },
  effects: {
    
  },

  reducers: {
    setState(state, action) {
      return { ...state, ...action.payload };
    },
    init(state, action) {
      return { ...state, ...action.payload };
    },
  },
};
